Caches are commonly used in computer systems. A cache is a collection of data duplicating original values stored elsewhere or computed earlier, where the original data is expensive to fetch (due to slow access time) or to compute, relative to the cost of reading the cache. In other words, a cache is a temporary storage area where frequently accessed data can be stored for rapid access. Once the data is stored in the cache, future use can be made by accessing the cached copy rather than re-fetching or recomputing the original data, so that the average access time is lower.
Caches have proven to be extremely effective in many areas of computing because access patterns in typical computer applications have locality of reference (temporal and spatial locality). Spatial locality refers to data that might or might not be located physically close to each other. Temporal locality refers to data that are accessed close together in time. However, enabling concurrent access as to the same data provide some challenges to maintain integrity of the data. For example, a reader may be accessing a document at a time when a writer is modifying the document.